home *** CD-ROM | disk | FTP | other *** search
/ Regional Industry Buying Guide: Greater Florida / 2000 Regional Industry Buying Guide - Greater Florida.iso / cs2k / clients / classic / scripts.lib / CONNECT.SCR < prev    next >
Encoding:
Text File  |  1998-09-30  |  10.4 KB  |  448 lines

  1. !
  2. !  Copyright (c) 1998
  3. !  by CompuServe Incorporated, Columbus, Ohio
  4. !
  5. !  The information in this software is subject to change without
  6. !  notice and should not be construed as a commitment by CompuServe.
  7. !
  8. !  CONNECT:
  9. !       Handles CompuServe and Direct.
  10. !
  11. !  NOTE:  It is recommended that the numeric codes for networks NOT be
  12. !       modified since other utility programs may assume the relationships
  13. !       of network names and network ids specified below.
  14. !
  15. !+V
  16. ! "4.0.5"
  17. !-V
  18.  
  19. !+N
  20. CompuServe = 1;         ! "CompuServe"
  21. UUNet = 49;             ! "CompuServe II"
  22. AlaskaNet = 36;         ! "AlaskaNet"
  23. ArgNet  = 37;           ! "ARG-Net"
  24. BT_Tymnet = 47;         ! "BT-Tymnet"
  25. Chilepac= 28;           ! "Chilepac"
  26. CSIRnet = 16;           ! "CSIR-Net"
  27. D1_NETZ = 42;           ! "D1-Netz"
  28. D2_NETZ = 43;           ! "D2-Netz"
  29. DataPac = 4;            ! "DataPac"
  30. Datex_J = 19;           ! "Datex-J"
  31. Datex_P = 10;           ! "Datex-P"
  32. E_PLUS = 41;            ! "E-Plus"
  33. EIRPAC = 33;            ! "EIRPAC"
  34. EQUANT = 45;            ! "Equant"
  35. FENICSII = 24;          ! "FENICS II/IV"
  36. FTConnect = 12;         ! "FT-Connect"
  37. GlobalOne = 46;         ! "Global One"
  38. InfoNet_Europe = 5;     ! "InfoNet-Euro"
  39. InfoNet_Korea = 29;     ! "InfoNet-Kor"
  40. InfoNet_SAfrica = 32;   ! "InfoNet-RSA"
  41. InfoNet_Taiwan = 30;    ! "InfoNet-Taiw"
  42. InfoNet_World = 6;      ! "InfoNet-Wrld"
  43. Internet = 25;          ! "Internet"
  44. ISRAKAV = 17;           ! "ISRAKAV"
  45. LATA = 7;               ! "LATA"
  46. CTLATA = 8;             ! "LATA-Ct"
  47. National = 44;          ! "National"
  48. PacNet = 21;            ! "PacNet"
  49. PlusNet = 38;           ! "PlusNet"
  50. PosServe = 27;          ! "HANJIN-NET"
  51. SCITOR = 34;            ! "SCITOR"
  52. SEVA = 35;              ! "SEVA"
  53. Telenet = 2;            ! "SprintNet"
  54. Telepac = 9;            ! "Telepac"
  55. Transpac = 18;          ! "Transpac"
  56. Trendline = 48;         ! "Trendline"
  57. TTNNet = 22;            ! "TTN-Net"
  58. Tymnet = 3;             ! "Tymnet"
  59. VNZNET = 23;            ! "VNZ-Net"
  60. Direct = 40;        ! "Direct"
  61. !-N
  62.  
  63. define %CR = "^M";
  64. define %FALSE = 0;
  65. define %TRUE = 1;
  66. define %ErrorCode = 0;
  67. define %PPP = "";
  68. define %GatewayFailure = 0;
  69. GatewayRetry = 0;
  70. define %State = 1;
  71. ! %State defines the state of the connection:
  72. !       1 - Opening port
  73. !       2 - Initializing modem
  74. !       3 - Dialing phone
  75. !       4 - Connecting through alternate gateway
  76. !       5 - Connecting to CompuServe network (Host Name:)
  77. !       6 - Responding to User ID
  78. !       7 - Responding to Password/Secure login
  79. !       8 - Exited success
  80. !       9 - Reserved
  81. !       10 - Disconnecting Network
  82. !       11 - Hanging up modem
  83. !       12 - Exited success
  84.  
  85. hangup = 1;
  86. UsingModem = %FALSE;
  87. CISNetwork = %FALSE;
  88. ifndef %App = "";
  89. if (%App = "CID") and (%Network = Internet) goto Dialer;
  90.  
  91. Initialize:
  92. !
  93. ! Main Program
  94. !
  95. init %Port, %BaudRate;
  96. if %_init goto Continue_Connect;
  97.  
  98. define %FailureMsg = "Could not initialize port";
  99. define %ErrorCode = 2;
  100. if %Network <> Internet goto Connect_Fatal;
  101. define %ErrorCode = 3;
  102. goto Connect_Fatal;
  103.  
  104. Dialer:
  105. define %Network = CompuServe;
  106. goto Initialize;
  107.  
  108. Continue_Connect:
  109.     call %Dir & "first.scr" () : Result;
  110.     if Result = %Cancel goto Cancel_Connect;
  111.     if Result = %Failure goto Connect_Failure;
  112.     if Result = %Fatal goto Connect_Fatal;
  113.  
  114.     on cancel goto Cancel_Connect;
  115.     DirectConnect = (%Network = Direct) or (%DialType = 2);
  116.  
  117.     if DirectConnect goto Connect_Network;
  118.  
  119.     call %Dir & "phone.scr" () : Result;
  120.  
  121.     if Result = %Cancel goto Cancel_Connect;
  122.     if Result = %Failure goto Connect_Failure;
  123.     if Result = %Fatal goto Connect_Fatal;
  124.     UsingModem = %TRUE;
  125.  
  126. Connect_Network:
  127.     if %Network = CompuServe goto Connect_CIS;
  128.     if %Network = Direct goto Connect_CIS;
  129.     if %Network = E_PLUS goto Connect_CIS;
  130.     if %Network = D1_NETZ goto Connect_CIS;
  131.     if %Network = D2_NETZ goto Connect_CIS;
  132.     if %Network = Internet goto Connect_CIS;
  133.     if %Network = PlusNet goto Connect_CIS;
  134.     if %Network = VNZNET goto Connect_CIS;
  135.     define %State = 4;
  136.     if %Network = Telenet goto Connect_Telenet;
  137.     if %Network = Tymnet goto Connect_Tymnet;
  138.     if %Network = BT_Tymnet goto Connect_Tymnet;
  139.     if %Network = DataPac goto Connect_DataPac;
  140.     if %Network = InfoNet_Europe goto Connect_InfoNet_Europe;
  141.     if %Network = InfoNet_Korea goto Connect_InfoNet_Korea;
  142.     if %Network = InfoNet_Taiwan goto Connect_InfoNet_Taiwan;
  143.     if %Network = InfoNet_SAfrica goto Connect_InfoNet_SAfrica;
  144.     if %Network = InfoNet_World goto Connect_InfoNet_World;
  145.     if %Network = LATA goto Connect_LATA;
  146.     if %Network = CTLATA goto Connect_CTLATA;
  147.     if %Network = Telepac goto Connect_Telepac;
  148.     if %Network = Datex_P goto Connect_Datex_P;
  149.     if %Network = Datex_J goto Connect_Datex_J;
  150.     if %Network = CSIRnet goto Connect_CSIRnet;
  151.     if %Network = ISRAKAV goto Connect_ISRAKAV;
  152.     if %Network = Trendline goto Connect_ISRAKAV;
  153.     if %Network = Transpac goto Connect_Transpac;
  154.     if %Network = GlobalOne goto Connect_Transpac;
  155.     if %Network = National goto Connect_National;
  156.     if %Network = PacNet goto Connect_PacNet;
  157.     if %Network = PosServe goto Connect_PosServe;
  158.     if %Network = TTNNet goto Connect_TTNNet;
  159.     if %Network = FENICSII goto Connect_FENICSII;
  160.     if %Network = Chilepac goto Connect_Chilepac;
  161.     if %Network = EIRPAC goto Connect_EIRPAC;
  162.     if %Network = SCITOR goto Connect_SCITOR;
  163.     if %Network = EQUANT goto Connect_SCITOR;
  164.     if %Network = SEVA goto Connect_SEVA;
  165.     if %Network = AlaskaNet goto Connect_AlaskaNet;
  166.     if %Network = ArgNet goto Connect_ArgNet;
  167.     if %Network = FTConnect goto Connect_FTConnect;
  168.     if %Network = UUNet goto Connect_UUNet;
  169.     
  170.     define %FailureMsg = "Network not supported";
  171.     goto Connect_Fatal;
  172.  
  173. !
  174. !  Connect to Telenet
  175. !
  176. Connect_Telenet:
  177.     call %Dir & "telenet.scr" () : Result;
  178.     goto Handle_Network_Return;
  179.  
  180. !
  181. !  Connect to Tymnet
  182. !
  183. Connect_Tymnet:
  184.     call %Dir & "tymnet.scr" (1) : Result;
  185.     goto Handle_Network_Return;
  186.  
  187. !
  188. !  Connect to DataPac
  189. !
  190. Connect_DataPac:
  191.     call %Dir & "datapac.scr" () : Result;
  192.     goto Handle_Network_Return;
  193.  
  194. !
  195. !  Connect to InfoNet World
  196. !
  197. Connect_InfoNet_World:
  198.     call %Dir & "infonet.scr" (0) : Result;
  199.     goto Handle_Network_Return;
  200.  
  201. !
  202. !  Connect to InfoNet Europe
  203. !
  204. Connect_InfoNet_Europe:
  205.     call %Dir & "infonet.scr" (1) : Result;
  206.     goto Handle_Network_Return;
  207.  
  208. !
  209. !  Connect to InfoNet Korea
  210. !
  211. Connect_InfoNet_Korea:
  212.     call %Dir & "infonet.scr" (2) : Result;
  213.     goto Handle_Network_Return;
  214.  
  215. !
  216. !  Connect to InfoNet Taiwan
  217. !
  218. Connect_InfoNet_Taiwan:
  219.     call %Dir & "infonet.scr" (3) : Result;
  220.     goto Handle_Network_Return;
  221.  
  222.  
  223. !
  224. !  Connect to InfoNet South Africa
  225. !
  226. Connect_InfoNet_SAfrica:
  227.     call %Dir & "infonet.scr" (5) : Result;
  228.     goto Handle_Network_Return;
  229.  
  230. !
  231. !  Connect to LATA
  232. !
  233. Connect_LATA:
  234.     call %Dir & "lata.scr" (%TRUE) : Result;
  235.     goto Handle_Network_Return;
  236.  
  237. !
  238. !  Connect to Connecticut LATA
  239. !
  240. Connect_CTLATA:
  241.     call %Dir & "lata.scr" (%FALSE) : Result;
  242.     goto Handle_Network_Return;
  243.  
  244. !
  245. !  Connect to Telepac
  246. !
  247. Connect_Telepac:
  248.     call %Dir & "telepac.scr" () : Result;
  249.     goto Handle_Network_Return;
  250.  
  251. !
  252. !  Connect to Datex-P
  253. !
  254. Connect_Datex_P:
  255.     call %Dir & "datexp.scr" () : Result;
  256.     goto Handle_Network_Return;
  257.  
  258. !
  259. !  Connect to Datex-J
  260. !
  261. Connect_Datex_J:
  262.     call %Dir & "datexj.scr" () : Result;
  263.     goto Handle_Network_Return;
  264.  
  265. !
  266. !  Connect to FT-Connect
  267. !
  268. Connect_FTConnect:
  269.     call %Dir & "ftconn.scr" () : Result;
  270.     goto Handle_Network_Return;
  271.  
  272.  
  273. !
  274. !  Connect to CSIR-Net
  275. !
  276. Connect_CSIRnet:
  277.     call %Dir & "csirnet.scr" () : Result;
  278.     goto Handle_Network_Return;
  279.  
  280. !
  281. !  Connect to ISRAKAV
  282. !
  283. Connect_ISRAKAV:
  284.     call %Dir & "israkav.scr" () : Result;
  285.     goto Handle_Network_Return;
  286.  
  287. !
  288. !  Connect to Transpac
  289. !
  290. Connect_Transpac:
  291.     call %Dir & "transpac.scr" (%FALSE) : Result;
  292.     goto Handle_Network_Return;
  293.  
  294. !
  295. !  Connect to Transpac-Ascend (France-Telecom Gateway)
  296. !
  297. Connect_National:
  298.     call %Dir & "transpac.scr" (%TRUE) : Result;
  299.     goto Handle_Network_Return;
  300.  
  301.  
  302. !
  303. !  Connect to AlaskaNet
  304. !
  305. Connect_AlaskaNet:
  306.     call %Dir & "tymnet.scr" (2) : Result;
  307.     goto Handle_Network_Return;
  308.  
  309. !
  310. !  Connect to ArgNet
  311. !
  312. Connect_ArgNet:
  313.     call %Dir & "argnet.scr" () : Result;
  314.     goto Handle_Network_Return;
  315.  
  316. !
  317. !  Connect to PacNet
  318. !
  319. Connect_PacNet:
  320.     call %Dir & "tymnet.scr" (3) : Result;
  321.     goto Handle_Network_Return;
  322.  
  323.     
  324. !
  325. !  Connect to Pos-Serve
  326. !
  327. Connect_PosServe:
  328.     call %Dir & "posserve.scr" () : Result;
  329.     goto Handle_Network_Return;
  330.  
  331. !
  332. !  Connect to TTN-Net
  333. !
  334. Connect_TTNNet:
  335.     call %Dir & "ttnnet.scr" (3) : Result;
  336.     goto Handle_Network_Return;
  337.  
  338. !
  339. !  Connect to FENICS II
  340. !
  341. Connect_FENICSII:
  342.     call %Dir & "fenics2.scr" (3) : Result;
  343.     goto Handle_Network_Return;
  344.  
  345. !
  346. !  Connect to Chilepac
  347. !
  348. Connect_Chilepac:
  349.     call %Dir & "chilepac.scr" (3) : Result;
  350.     goto Handle_Network_Return;
  351.  
  352. !
  353. !  Connect to EIRPAC
  354. !
  355. Connect_EIRPAC:
  356.     call %Dir & "eirpac.scr" () : Result;
  357.     goto Handle_Network_Return;
  358.  
  359. !
  360. !  Connect to SCITOR
  361. !
  362. Connect_SCITOR:
  363.     call %Dir & "scitor.scr" () : Result;
  364.     goto Handle_Network_Return;
  365.  
  366. !
  367. !  Connect to SEVA
  368. !
  369. Connect_SEVA:
  370.     call %Dir & "seva.scr" () : Result;
  371.     goto Handle_Network_Return;
  372.  
  373.  
  374. !
  375. !  Connect to UUNet
  376. !
  377. Connect_UUNet:
  378.     call %Dir & "uunet.scr" () : Result;
  379.     goto Handle_Network_Return;
  380.  
  381.  
  382. !
  383. !  Handle Network Return
  384. !
  385. Handle_Network_Return:
  386.     if Result = %Success goto Do_CIS_Script;
  387.     if Result = %Cancel goto Cancel_Connect;
  388.     if Result = %Fatal goto Connect_Fatal;
  389.     goto Connect_Failure;
  390.  
  391. !
  392. !  Connect to CIS
  393. !
  394. Connect_CIS:
  395.     CISNetwork = %TRUE;
  396.     send %CR;
  397.  
  398. Do_CIS_Script:
  399.     call %Dir & "cserve.scr" (DirectConnect, CISNetwork) : Result;
  400.     if Result = %Failure goto Connect_Failure;
  401.     if Result = %Cancel goto Cancel_Connect;
  402.     if Result = %Fatal goto Connect_Fatal;
  403.     exit %Success;
  404.  
  405. Connect_Failure:
  406.     if %GatewayFailure = 0 goto ExitFailure;
  407.     define %GatewayFailure = 0;
  408.     if GatewayRetry = 3 goto ExitFailure;
  409.     GatewayRetry = GatewayRetry + 1;
  410.     wait until 50;
  411.     reset;
  412.     goto Initialize;
  413.  
  414. ExitFailure:
  415.  
  416.     gosub Hangup_Connect;
  417.     reset;
  418.     exit %Failure;
  419.  
  420. Connect_Fatal:
  421.     if %GatewayFailure = 0 goto Gateway_OK;
  422.     define %GatewayFailure = 0;
  423.     if GatewayRetry = 3 goto ExitFailure;
  424.     GatewayRetry = GatewayRetry + 1;
  425.     wait until 50;
  426.     reset;
  427.     goto Initialize;
  428.  
  429. Gateway_OK:
  430.  
  431.     gosub Hangup_Connect;
  432.     reset;
  433.     exit %Fatal;
  434.  
  435. Hangup_Connect:
  436.     if not UsingModem goto Hangup_Done;
  437.     define %LOCAL = 1;
  438.     call %Dir & "disconct.scr" ();
  439. Hangup_Done:
  440.     return;
  441.  
  442. Cancel_Connect:
  443.     show "Connect cancelled";
  444.     gosub Hangup_Connect;
  445.     reset;
  446.     define %ErrorCode = 1;
  447.     exit %Cancel;
  448.